Javascript function name

Description

The name of the JavaScript function to call to populate the FormView control. You must include the () with the function name. E.G. myJSFunction().

Discussion

If the FormView control's Datasource type is set to Javascript Function, the Javascript function name is the JavaScript function called to fetch the data to populate the FormView control. For example, if you're JavaScript function is called "getFormViewData()", you would enter getFormViewData() as the value for Javascript function name.

The JavaScript function that computes the data must return a JSON object. For example:

function getFormViewData() {

    var json = [{
    "Firstname": "John",
    "Lastname": "Smith",
    "City": "Boston",
    "State": "MA"
},
{
    "Firstname": "Henry",
    "Lastname": "Rhodes",
    "City": "New York",
    "State": "NY"
},
{
    "Firstname": "Allison",
    "Lastname": "Berman",
    "City": "Los Angeles",
    "State": "CA"
},
{
    "Firstname": "Amanda",
    "Lastname": "Higgins",
    "City": "Chicago",
    "State": "IL"
},
{
    "Firstname": "Nancy",
    "Lastname": "Clark",
    "City": "Boston",
    "State": "MA"
},
{
    "Firstname": "Cecelia",
    "Lastname": "Dawkins",
    "City": "Boulder",
    "State": "CO"
},
{
    "Firstname": "Kathy",
    "Lastname": "Morton",
    "City": "New York",
    "State": "NY"
}];

    return json;
}

If the FormView is populated from a JavaScript function, you must specify sample JSON in the Sample data property. The sample data is used to inform the FormView builder what fields are available for configuring Editors, Editor Sets, and FormView Layout. Sample data for the example JavaScript above could be defined as:

[{
    "Firstname": "John",
    "Lastname": "Smith",
    "City": "Boston",
    "State": "MA"
}]